package com.WISSC.controller;


import com.WISSC.bean.ztree.ZtreeBean;
import com.WISSC.commen.BaseController;
import com.WISSC.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * <p>
 * 菜单表 前端控制器
 * </p>
 *
 * @author 冯政尚
 * @since 2019-06-03
 */
@Controller
@RequestMapping("/menu")
public class MenuController extends BaseController {

    @Autowired
    MenuService menuService;

    @RequestMapping(value = "/findPermission", method = RequestMethod.POST)
    @ResponseBody
    public List<ZtreeBean> findPermission(HttpSession session) {
        return menuService.findMenuZtree(getUser(session).getId());
    }

}
